home *** CD-ROM | disk | FTP | other *** search
- program record_initialization;
-
- {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
- { Program to illustrate the initialization of a record by conventional }
- { means as opposed to the use of 'objects'. }
- { }
- { RECINIT.PAS -> RECINIT.EXE R. Shaw 17.2.91 }
- {________________________________________________________________________}
-
- uses Crt;
-
- type
- Rec = record
- i : integer;
- r : real;
- s : string[50];
- end;
-
- procedure Init( int : integer; re : real; st : string; var DataRec : Rec);
-
- begin
- with DataRec do
- begin
- i := int;
- r := re;
- s := st;
- end;
- end; { of procedure Init }
-
- var
- ThisRec : Rec;
-
- begin
- ClrScr;
- Init(1234, 9.876, 'This is the string entry for this record', ThisRec);
- writeln( 'The integer value is ', ThisRec.i);
- writeln( 'The real value is ', ThisRec.r);
- writeln( 'The string is " ', ThisRec.s, '"');
- writeln;
- writeln;
- write('Press any key to continue: ');
- repeat until keypressed;
- end.
-
-